package Day29.lx.principle.ocp;

import java.util.ArrayList;

public class BookStore {
    private static ArrayList<IBook> bookList = new ArrayList<>();

    static {
        bookList.add(new offNovelBook("红楼梦",9900,"曹雪芹"));
        bookList.add(new offNovelBook("侠客行",8900,"金庸"));
        bookList.add(new offNovelBook("原则",6900,"瑞达利欧"));
        bookList.add(new offNovelBook("海贼王1",4900,"尾田荣一郎"));
    }

    //如果后续需要打折   子类继承父类
    public static void main(String[] args) {
        System.out.println("----------------------");
        for (IBook book:bookList) {
            System.out.println("书籍名称:" + book.getName() + "\t\t作者:" + book.getAuthor() + "\t\t价格:￥" + book.getPrice()/100.0 + "元");
        }
    }
}
